package week02;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import java.io.IOException;

/**
 * @author edward
 * @since 2021-07-05
 */
public class OkHttpRequester {

    private static OkHttpClient client = new OkHttpClient();

    private void requestNettyDemoServer() throws IOException {
        Request request = new Request.Builder().url("http://127.0.0.1:8088/test").build();
        try (Response response = client.newCall(request).execute()) {
            System.out.println(response.body().string());
        }
    }

    public static void main(String[] args) throws IOException {
        OkHttpRequester requester = new OkHttpRequester();
        requester.requestNettyDemoServer();
    }
}
